<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./03_functor.js"></script>

    <script>
      const toRMB = (s) =>
        Functor.of(s)
          .map((v) => v.replace("$", ""))
          .map(parseFloat)
          .map((v) => v * 7.5)
          .map((v) => v.toFixed(2))
          .value((v) => "¥" + v);

      console.log(toRMB("$100")); // ¥750.00
    </script>
  </body>
</html>
